{% extends "../base.html" %}
{% block main %}
    <div class="post">
        <hgroup>
            <h1><a href="/post/id/{{ post.id }}">
                <img src="{{ handler.gravatar(post.user.email, size=35).get_image() }}">
                {{ post.title }}
            </a></h1>
            <span class="glyphicon glyphicon-calendar"> {{ post.pub_date }}</span>&nbsp&nbsp
            <span class="glyphicon glyphicon-tags">
                {% for t in post.tags %}
                    <a href="/tag/{{ t.tag }}">{{ t.tag }}</a>&nbsp
                {% end %}
            </span>&nbsp
            {% if current_user %}
                <a href="/post/edit/{{ post.id }}">
                    <span class="glyphicon glyphicon-edit"></span>
                </a> |
                <a href="/post/delete/{{ post.id }}" title="删除" class="delete">
                    <span class="glyphicon glyphicon-trash"></span>
                </a>
            {% end %}&nbsp&nbsp
        </hgroup>
        <hr>
        <p>{% raw handler.markdown(post.content) %}</p>
        <hr>
    </div>
    <div>
        <span class="col-md-8 glyphicon glyphicon-tags" title="标签">
            {% for t in post.tags %}
                <a href="/tag/{{ t.tag }}">{{ t.tag }}</a>
            {% end %}
        </span>&nbsp
        <hr>
    </div>
    <div class="comment">
        <div id="disqus_thread"></div>
        <script type="text/javascript">
            /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
            var disqus_shortname = 'maguowei'; // required: replace example with your forum shortname

            /* * * DON'T EDIT BELOW THIS LINE * * */
            (function() {
                var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
            })();
        </script>
        <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
        <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
    </div>
{% end %}
{% block side %}
    {% module Tag(side['tags']) %}
    {% module RandomPost(side['random_post']) %}
{% end %}